import Vue from 'vue'
import VueRouter from 'vue-router'
import PostList from '../components/PostList'
import Article from '../components/Article.vue'
import UserInfo from '../components/UserInfo.vue'
import SlideBar from '../components/SlideBar.vue'

Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    {
      name: 'root',
      path: '/',
      components: { main: PostList }
    },
    {
      name: 'post_content',
      path: '/topic/:id&author=:name',
      components: { main: Article, slideBar: SlideBar }
    },
    {
      name: 'userInfo',
      path: '/user_info/:name',
      components: {
        main: UserInfo
      }
    }
  ]
})

export default router
